<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>查看文章</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/backend/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/backend/css/public.css" media="all">
</head>
<body>
<form class="layui-form layuimini-form">
    <input type="hidden" name="id" value="{$article['id']}">
    <div class="layui-form-item">
        <label class="layui-form-label required">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required|title" lay-reqtext="标题不能为空" placeholder="请输入标题" value="{$article['title']}" class="layui-input" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">商品分类</label>
        <div class="layui-input-block">
            <select name="category" lay-verify="required" readonly="readonly">
                {foreach $category as $k=>$v}
                <option value="{$k}" {if ($k == '_'.$article['articleCategory']['id'])}selected="selected"{/if}>{$v|raw}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">内容</label>
        <div id="content" class="layui-input-block">
            {:htmlspecialchars_decode($article['articleContent']['content'])}
        </div>
    </div>
</form>
<script src="/static/backend/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="/static/backend/js/wangEditor.min.js"></script>
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
    });

    // 富文本编辑器
    const E = window.wangEditor;
    const editor = new E('#content');
    // 配置z-index
    editor.config.zIndex = 500;
    // 配置server接口地址
    editor.create();
    // 禁用编辑器
    editor.disable();
</script>
</body>
</html>